<?php
       
  
   require_once  'Classes/Model/HTTPRequestModel.php';
    
   /*
   require_once 'Classes/Model/ArticleModel.php';
   require_once 'Classes/View/Pages/ListElementsPage.php';

   $Model = new ArticleModel();
   echo "Action : ".$_GET['action'];
   die();
   $page = new ListElementsPage("Family");
   $page->addElement($Model->getAllArticles());
   $page->addCSS("Ressources/style.css");
    
   $page->display();
   
   $model = ArticleModel::getInstance();
   
   var_dump($model->getAllArticles());
    
   */
 
  
   
   
   $controller;
   switch (HTTPRequestModel::getInstance()->extractGETValue('controller')){
        case 'Family':
            require_once 'Classes/Controllers/FamiliesController.php';
            $controller = new FamiliesController();
            break;
        case 'Article':
            require_once 'Classes/Controllers/ArticlesController.php';
            $controller = new ArticlesController();
            break;
        case 'Subfamily':
            require_once 'Classes/Controllers/Sub_FamiliesController.php';
            $controller = new Sub_FamiliesController();
            break;
        case 'Structure':
            require_once 'Classes/Controllers/StructureController.php';
            $controller = new StructureController();
            break;
        case 'Loans':
            require_once 'Classes/Controllers/LoanController.php';
            $controller = new LoanController();
            break;
        default:
            throw new Exception("Action not found");
            break;
       
   }
   
        $controller->processRequest();
   
   
   
?>